﻿using Azure.Core;
using DataModels.Dto;
using DataModels.Dto.Livelihood;
using DataModels.Entities.Base;
using DataModels.Entities.Livelihood;
using Microsoft.AspNetCore.Mvc;
using PropertyManagementWebApi.Controllers;
using Services.Decoration;
using Services.Livelihood;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataModels.Enums.Livelihood
{
    public class ScoreActivityController(ScoreActivityService scoreActivityService) : BaseController
    {
        protected readonly ScoreActivityService _scoreActivityService = scoreActivityService;

        /// <summary>
        /// 获取积分和花费的积分
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetPointsAndExpenses(Guid? projectid = null) { 
            return _scoreActivityService.GetPointsAndExpenses(projectid);
        }
        /// <summary>
        /// 获取积分活动
        /// </summary>
        /// <param name="pageRequst"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel GetScoreActivityPage([FromBody] ScoreActivityPageRequest pageRequst) {
           return  _scoreActivityService.GetScoreActivityPage(pageRequst);
        }

        /// <summary>
        /// 兑换商品
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel UpdataServiceDayPoint(UpdataServiceDayPointRequest request) {
            return _scoreActivityService.UpdataServiceDayPoint(request);
        }
        /// <summary>
        /// 获取消费记录
        /// </summary>
        /// <param name="requst"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel GetLivelihoodActivityPointst(GetLivelihoodActivityPointstRequst requst) {
            return _scoreActivityService.GetLivelihoodActivityPointst(requst);
        }

    }
}
